package com.briup.cms.web.controller;


import com.briup.cms.bean.Comment;
import com.briup.cms.service.ICommentService;
import com.briup.cms.utils.Message;
import com.briup.cms.utils.MessageUtil;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = {"})
        @RestController
        @RequestMapping({"/auth/comment"})
        public class CommentController {
        @Autowired
        private ICommentService commentService;

        @ApiOperation(")
                @ApiImplicitParams({@ApiImplicitParam(name = "pageNum", value = ", required = true, paramType = "query"), @ApiImplicitParam(name = "pageSize", value = ", required = true, paramType = "query"), @ApiImplicitParam(name = "keywords", value = ", paramType = "query")})
        @GetMapping({"/pageQuery"})
        public Message pageQuery(int pageNum, int pageSize, String keywords) {
        PageInfo<Comment> data = this.commentService.pageQuery(pageNum, pageSize, keywords);
        return MessageUtil.success(data);
        }

        @ApiOperation(")
                @DeleteMapping({"/batchDelete"})
                public Message batchDelete(int[] ids) {
        this.commentService.batchDelete(ids);
        return MessageUtil.success(");
        }

        @ApiOperation(")
                @DeleteMapping({"/deleteById"})
                public Message deleteById(int id) {
        this.commentService.deleteById(id);
        return MessageUtil.success(");
        }

        @ApiOperation(value = ", notes = "status)
        @PutMapping({"/check"})
        public Message check(int id, int status) {
        this.commentService.checkComment(id, status);
        return MessageUtil.success(");
        }
        }
